all: main

CXX := g++
LD := ${CXX}

# Flags to enable link-time optimization and GDB
LTO := -flto
ENABLE_DGB :=

ORCL_HOME := ../

INC	:= -I ${ORCL_HOME}

#DEBUG := -DNDEBUG
CPPFLAGS := ${ENABLE_DGB} ${LTO} ${DEBUG} -O0 -std=c++11 ${INC} -Wall \
	-Wno-unused-result -Wno-unused-value -Wno-unused-function \
	-Winline

LDFLAGS := ${ENABLE_DGB} ${LTO} -O0 -libverbs -lrt -pthread -lmemcached -lnuma


src := ${ORCL_HOME}/libORCL/ORCL_conn.o  \
 ${ORCL_HOME}/libORCL/ORCL_tool.o ${ORCL_HOME}/libORCL/ORCL_share.o \
 ${ORCL_HOME}/libORCL/ORCL.o ${ORCL_HOME}/libORCL/ORCL_sync.o ${ORCL_HOME}/libORCL/ORCL_forward_thread.o ${ORCL_HOME}/libORCL/ORCL_comm.o \
 ${ORCL_HOME}/libORCL/ORCL_device.o  main.o

main: ${src}
	${LD} -o $@ $^ ${LDFLAGS}

PHONY: clean
clean:
	rm -f *.o main ${src}
